import request from '@/router/axios'

export function fetchPvmArcOptometryList(query) {
  return request({
    url: '/pvm/arcOptometry/page',
    method: 'get',
    params: query
  })
}
//未完善列表，由后台自动创建
export function fetchNotCompleteList(query) {
  return request({
    url: '/pvm/arcOptometry/completePage',
    method: 'get',
    params: query
  })
}

export function createByDate(query) {
  return request({
    url: '/pvm/arcOptometry/createByDate',
    method: 'get',
    params: query
  })
}

//病例中心分页查询
export function getInfoPageByCaseHistoryParam(query) {
  return request({
    url: '/pvm/arcOptometry/getInfoByCaseHistoryParam',
    method: 'get',
    params: query
  })
}

export function getOptometryListExport(obj) {
  return request({
    url: '/pvm/arcOptometry/excel',
    method: 'post',
    data: obj,
    responseType: 'blob'
  })
}

export function addPvmArcOptometryObj(obj) {
  return request({
    url: '/pvm/arcOptometry',
    method: 'post',
    data: obj
  })
}

export function getPvmArcOptometryObj(id) {
  return request({
    url: '/pvm/arcOptometry/' + id,
    method: 'get'
  })
}

export function delPvmArcOptometryObj(id) {
  return request({
    url: '/pvm/arcOptometry/' + id,
    method: 'delete'
  })
}

export function putPvmArcOptometryObj(obj) {
  return request({
    url: '/pvm/arcOptometry',
    method: 'put',
    data: obj
  })
}

// 根据就诊卡号、唯一编码、检查日期获取检查记录
export function getCheckRecord(obj){
  return request({
    url: '/pvm/arcOptometry/getTempCheckData',
    method: 'get',
    params: obj
  })
}


// 获取打印报告单数据
export function getReportData(id){
  return request({
    url: '/pvm/arcOptometry/getInfoPrint/' + id,
    method: 'get'
  })
}

// 根据人员获取打印报告单数据
export function getReportDataByPerson(personId){
  return request({
    url: '/pvm/arcOptometry/getInfoPrintByPerson/' + personId,
    method: 'get'
  })
}

// 根据人员获取打印角塑初诊报告单数据
export function getVisitReportDataByPerson(personId,checkType){
  return request({
    url: '/pvm/ckcorneal/getByPerson/' + personId + '/' + checkType,
    method: 'get'
  })
}
